I have to create a script that counts the amount of inlinks of a module. However, I have to exclude counting links whose linked object's attribute is not a specific value. I have to do this with a list of modules contained in a master list module so I have 2 level trace. I have been having trouble implementing as each solution I tried to implement either failed to have a correct output or would be stuck in a loop. Most of the trouble comes from accessing the linked object to read in their values.
I tried two major solutions to read in the linked object: -Stored the source module in a Skiplist with the linkref loop then in the link loop access the skiplist data to read the module then check the source object's content. The basic format is something like below
This script will execute, but will not give back any values. I apply the same object verification check for outlinks and they return accurate values. -Use linkRef loop to call load(ModuleVersion) for each module found in the link. Then use the link loop to read object without the read function.
The script gets stuck in execution for a long time.
I think this may be because I have a hazy understanding on how to extract inlink object in DXL. I have seen several scripts that does so, but they all seem to have different means of achieving it and I have a hard time deciphering the reasoning behind each of them. This is probably due to 2 things: -I do not know why linlink objects behave differently from outlink objects -I have a hard time understanding the purpose of certain types like linkRef, link, Modname_, and moduleVersion and how they interact with each other. Several methods for inlink traces use these types.
It would be nice to know if anyone has a quick suggestion for the problem above (If you need more info I will detail them). However, I am more concerned of my lack of understanding of the properties of inlinks and types. If anyone has any references or knowledge that would enlighten me I will be grateful.
Patrick Shin
spat92 - Mon Nov 21 16:45:07 EST 2016 |
Re: Tracing Inlink based upon Inlink Objects Content No there are not really different ways to do it. They just differ in the error handling and the correct treatment of baselines. You can find a proper way to iterate links here: Trace operations can be expensive, as they involve opening all the target modules. For large modules this can easily lead to very long runtimes and also memory problems. Regards, Mathias |